Skip to content

feat: expose editor viewport and line annotation props in Rust and TypeScript - #264

Draft
sgammon wants to merge 1 commit into
stencil-hq:mainfrom
sgammon:feat/editor-inspection-props
Draft

sgammon wants to merge 1 commit into
stencil-hq:mainfrom
sgammon:feat/editor-inspection-props

Conversation

@sgammon

@sgammon sgammon commented Nov 6, 2026 •

Copy link
Copy Markdown

The documented TSP editor supports viewport controls and per-line annotations, but the Rust builder and TypeScript EditorProps omit them. This patch exposes those existing host capabilities through the typed SDKs for source inspection and historical-source previews.

Adds highlight, nowrap, topline, followCursor (follow_cursor in Rust), gutter, and virt. Gutter and virtual-line entries reuse the existing text/span representations. All properties remain optional, preserving Tern's defaults and existing wire output.

Protocol reference: TSP editor properties.

These properties apply to program-owned TSP editor nodes. The native file-buffer provider proposal remains tracked separately in #263.

Validation:

  • Rust serialization tests cover wire names, explicit false/zero, Unicode source, styled/string annotations, omitted defaults, and clearing annotation arrays.
  • TypeScript typed JSX tests cover false/zero, Unicode, styled/string annotations, and omitted defaults.
  • cargo test --manifest-path rust/Cargo.toml: 49 unit, 23 integration, and 14 doc tests passed.
  • bun test: 74 tests passed; bun run typecheck passed.

The Rust tests used a temporary workspace manifest to isolate this checkout from its enclosing workspace; no dependency or manifest changes are included.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant